<?php

/**
 * Controller is the customized base controller class.
 * All controller classes for this application should extend from this base class.
 */
class Controller extends CController {

    /**
     * @var string the default layout for the controller view. Defaults to '//layouts/column1',
     * meaning using a single column layout. See 'protected/views/layouts/column1.php'.
     */
    public $layout = '/layouts/main';

    /**
     * @var array context menu items. This property will be assigned to {@link CMenu::items}.
     */
    public $menu = array();

    /**
     * @var array the breadcrumbs of the current page. The value of this property will
     * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}
     * for more details on how to specify this property.
     */
    public $breadcrumbs = array();
    public $model;

    protected function deleteLink($params = array(), $alt = "") {
        echo CHtml::ajaxLink(' ', $this->createUrl('delete', $params), array(
            'success' => "function( )
                  {
                    $.get(document.location.href,function(html){\$('html').html(html)});
                  }"), array('class' => 'delete', 'alt' => $alt));
    }
    protected function viewLink($params = array(), $alt = "") {
        echo CHtml::link(' ', $this->createUrl('view', $params), array('class' => 'view', 'alt' => $alt));
    }

    protected function updateLink($params = array(), $alt = "") {
        echo CHtml::link(' ', $this->createUrl('update', $params), array('class' => 'update', 'alt' => $alt));
    }

    protected function searchLink($params = array(), $alt = "") {
        echo CHtml::link(' ', $this->createUrl('search', $params), array('class' => 'search', 'alt' => $alt));
    }

    protected function importLink($params = array(), $alt = "") {
        echo CHtml::link(' ', $this->createUrl('import', $params), array('class' => 'database', 'alt' => $alt));
    }

}